package com.yonyou.brigade.basic_init.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.yonyou.brigade.basic_init.dao.BriChannelAccountMapper;
import com.yonyou.brigade.basic_init.model.BriChannelAccount;
import com.yonyou.brigade.basic_init.service.IBriChannelAccountService;
import org.springframework.stereotype.Service;

/**
 *  租户主子账户服务实现类
 *
 * @author kangfw5@yonyou.com
 * @since 2019-01-07
 */
@Service
public class BriChannelAccountServiceImpl extends ServiceImpl<BriChannelAccountMapper, BriChannelAccount> implements IBriChannelAccountService {

    @Override
    public BriChannelAccount getEnableChannelAccountByAccount(String account) {
        Wrapper<BriChannelAccount> briChannelAccountWrapper = new EntityWrapper<>();
        briChannelAccountWrapper.where("account={0}", account);
        briChannelAccountWrapper.where("enabled={0}", 1);
        return selectOne(briChannelAccountWrapper);
    }
}
